package com.qd.common.panda.domain.entity.etc;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.cdqidi.util.page.BaseQuery;
import com.cdqidi.valid.group.DefaultGroup;
import com.cdqidi.valid.group.DeleteGroup;
import com.cdqidi.valid.group.UpdateGroup;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;

/**
 * 跳转记录
 *
 * @author sjk
 */
@EqualsAndHashCode(callSuper = true)
@Getter
@Setter
public class EtcJumpDTO extends BaseQuery {

    @ExcelIgnore
    @JsonIgnore
    private static final String EXCEL_TITLE = "跳转记录";
    /**
     * 主键
     */
    @ExcelProperty(value = {EXCEL_TITLE, "记录ID"})
    @NotBlank(message = "记录ID不能为空", groups = {DeleteGroup.class, UpdateGroup.class})
    @Size(max = 50, message = "记录ID长度不能超过{max}位", groups = {DeleteGroup.class, UpdateGroup.class})
    private String logId;
    /**
     * 用户ID
     */
    @ExcelProperty(value = {EXCEL_TITLE,"用户ID"})
    @Size(max = 50, message = "用户ID长度不能超过{max}位", groups = DefaultGroup.class)
    private String userId;
    /**
     * 手机号
     */
    @ExcelProperty(value = {EXCEL_TITLE,"手机号"})
    @Size(max = 20, message = "手机号长度不能超过{max}位", groups = DefaultGroup.class)
    private String mobile;
    /**
     * 车牌
     */
    @ExcelProperty(value = {EXCEL_TITLE,"车牌"})
    @NotBlank(message = "车牌不能为空", groups = DefaultGroup.class)
    @Size(max = 20, message = "车牌长度不能超过{max}位", groups = DefaultGroup.class)
    private String plateNumber;
    /**
     * 车牌颜色
     */
    @ExcelIgnore
    private Integer vehicleColor;
    /**
     * 添加时间
     */
    @ExcelProperty(value = {EXCEL_TITLE,"添加时间"})
    private LocalDateTime addTime;

    @Override
    public void freeData() {
        this.logId = null;
        this.mobile = null;
        this.addTime = null;
        this.userId = null;
        this.plateNumber = null;
        this.vehicleColor = null;
        super.freeData();
    }
}
